package cn.iocoder.yudao.module.bpm.api.amis;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.bpm.api.amis.dto.AmisListColumConfigDto;
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 获取amis表单配置信息")
public interface AmisFormConfigApi {

    String PREFIX = ApiConstants.PREFIX + "/amis-config";

    @GetMapping(PREFIX + "/getAmisFormConfig")
    @Operation(summary = "解析并获取AMIS配置（提供给内部）")
    @Parameters({
            @Parameter(name = "amisFormCode", description = "表单Key", required = true) ,
            @Parameter(name = "type", description = "amis表单配置中列表组件的类型", required = true) ,
    })
    CommonResult<List<AmisListColumConfigDto>> getAmisFormConfig(
            @RequestParam("formKey")  String formKey,
            @RequestParam("type")  String type
    );
}
